home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / stk-3.002 / stk-3 / STk-3.1 / Tcl / tcl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-31  |  39.2 KB  |  1,059 lines

  1. /*
  2.  * tcl.h --
  3.  *
  4.  *    This header file describes the externally-visible facilities
  5.  *    of the Tcl interpreter.
  6.  *
  7.  * Copyright (c) 1987-1994 The Regents of the University of California.
  8.  * Copyright (c) 1994-1996 Sun Microsystems, Inc.
  9.  *
  10.  * See the file "license.terms" for information on usage and redistribution
  11.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  12.  *
  13.  * SCCS: @(#) tcl.h 1.266 96/04/10 11:25:19
  14.  */
  15.  
  16. #ifndef _TCL
  17. #define _TCL
  18.  
  19. /*
  20.  * The following definitions set up the proper options for Windows
  21.  * compilers.  We use this method because there is no autoconf equivalent.
  22.  */
  23.  
  24. #if defined(_WIN32) && !defined(__WIN32__)
  25. #   define __WIN32__
  26. #endif
  27.  
  28. #ifdef __WIN32__
  29. #   undef USE_PROTOTYPE
  30. #   undef HAS_STDARG
  31. #   define USE_PROTOTYPE
  32. #   define HAS_STDARG
  33. #endif
  34.  
  35. #ifdef WIN32
  36. #   undef USE_PROTOTYPE
  37. #   undef HAS_STDARG
  38. #   define USE_PROTOTYPE
  39. #   define HAS_STDARG
  40. #endif
  41.  
  42. #ifndef BUFSIZ
  43. #include <stdio.h>
  44. #endif
  45.  
  46. #define TCL_VERSION "7.5"
  47. #define TCL_MAJOR_VERSION 7
  48. #define TCL_MINOR_VERSION 5
  49.  
  50. /*
  51.  * Definitions that allow Tcl functions with variable numbers of
  52.  * arguments to be used with either varargs.h or stdarg.h.  TCL_VARARGS
  53.  * is used in procedure prototypes.  TCL_VARARGS_DEF is used to declare
  54.  * the arguments in a function definiton: it takes the type and name of
  55.  * the first argument and supplies the appropriate argument declaration
  56.  * string for use in the function definition.  TCL_VARARGS_START
  57.  * initializes the va_list data structure and returns the first argument.
  58.  */
  59.  
  60. #if defined(__STDC__) || defined(HAS_STDARG)
  61. #   define TCL_VARARGS(type, name) (type name, ...)
  62. #   define TCL_VARARGS_DEF(type, name) (type name, ...)
  63. #   define TCL_VARARGS_START(type, name, list) (va_start(list, name), name)
  64. #else
  65. #   ifdef __cplusplus
  66. #    define TCL_VARARGS(type, name) (type name, ...)
  67. #    define TCL_VARARGS_DEF(type, name) (type va_alist, ...)
  68. #   else
  69. #    define TCL_VARARGS(type, name) ()
  70. #    define TCL_VARARGS_DEF(type, name) (va_alist)
  71. #   endif
  72. #   define TCL_VARARGS_START(type, name, list) \
  73.     (va_start(list), va_arg(list, type))
  74. #endif
  75.  
  76. /*
  77.  * Definitions that allow this header file to be used either with or
  78.  * without ANSI C features like function prototypes.
  79.  */
  80.  
  81. #undef _ANSI_ARGS_
  82. #undef CONST
  83.  
  84. #if ((defined(__STDC__) || defined(SABER)) && !defined(NO_PROTOTYPE)) || defined(__cplusplus) || defined(USE_PROTOTYPE)
  85. #   define _USING_PROTOTYPES_ 1
  86. #   define _ANSI_ARGS_(x)    x
  87. #   define CONST const
  88. #else
  89. #   define _ANSI_ARGS_(x)    ()
  90. #   define CONST
  91. #endif
  92.  
  93. #ifdef __cplusplus
  94. #   define EXTERN extern "C"
  95. #else
  96. #   define EXTERN extern
  97. #endif
  98.  
  99. /*
  100.  * Macro to use instead of "void" for arguments that must have
  101.  * type "void *" in ANSI C;  maps them to type "char *" in
  102.  * non-ANSI systems.
  103.  */
  104. #ifndef __WIN32__
  105. #ifndef VOID
  106. #   ifdef __STDC__
  107. #       define VOID void
  108. #   else
  109. #       define VOID char
  110. #   endif
  111. #endif
  112. #else /* __WIN32__ */
  113. /*
  114.  * The following code is copied from winnt.h
  115.  */
  116. #ifndef VOID
  117. #define VOID void
  118. typedef char CHAR;
  119. typedef short SHORT;
  120. typedef long LONG;
  121. #endif
  122. #endif /* __WIN32__ */
  123.  
  124. /*
  125.  * Miscellaneous declarations.
  126.  */
  127.  
  128. #ifndef NULL
  129. #define NULL 0
  130. #endif
  131.  
  132. #ifndef _CLIENTDATA
  133. #   if defined(__STDC__) || defined(__cplusplus)
  134.     typedef void *ClientData;
  135. #   else
  136.     typedef int *ClientData;
  137. #   endif /* __STDC__ */
  138. #define _CLIENTDATA
  139. #endif
  140.  
  141. /*
  142.  * Data structures defined opaquely in this module.  The definitions
  143.  * below just provide dummy types.  A few fields are made visible in
  144.  * Tcl_Interp structures, namely those for returning string values.
  145.  * Note:  any change to the Tcl_Interp definition below must be mirrored
  146.  * in the "real" definition in tclInt.h.
  147.  */
  148.  
  149. typedef struct Tcl_Interp{
  150.     char *result;        /* Points to result string returned by last
  151.                  * command. */
  152.     void (*freeProc) _ANSI_ARGS_((char *blockPtr));
  153.                 /* Zero means result is statically allocated.
  154.                  * TCL_DYNAMIC means result was allocated with
  155.                  * ckalloc and should be freed with ckfree.
  156.                  * Other values give address of procedure
  157.                  * to invoke to free the result.  Must be
  158.                  * freed by Tcl_Eval before executing next
  159.                  * command. */
  160.     int errorLine;        /* When TCL_ERROR is returned, this gives
  161.                  * the line number within the command where
  162.                  * the error occurred (1 means first line). */
  163. } Tcl_Interp;
  164.  
  165. typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler;
  166. typedef struct Tcl_Command_ *Tcl_Command;
  167. typedef struct Tcl_Event Tcl_Event;
  168. typedef struct Tcl_File_ *Tcl_File;
  169. typedef struct Tcl_Channel_ *Tcl_Channel;
  170. typedef struct Tcl_RegExp_ *Tcl_RegExp;
  171. typedef struct Tcl_TimerToken_ *Tcl_TimerToken;
  172. typedef struct Tcl_Trace_ *Tcl_Trace;
  173.  
  174. /*
  175.  * When a TCL command returns, the string pointer interp->result points to
  176.  * a string containing return information from the command.  In addition,
  177.  * the command procedure returns an integer value, which is one of the
  178.  * following:
  179.  *
  180.  * TCL_OK        Command completed normally;  interp->result contains
  181.  *            the command's result.
  182.  * TCL_ERROR        The command couldn't be completed successfully;
  183.  *            interp->result describes what went wrong.
  184.  * TCL_RETURN        The command requests that the current procedure
  185.  *            return;  interp->result contains the procedure's
  186.  *            return value.
  187.  * TCL_BREAK        The command requests that the innermost loop
  188.  *            be exited;  interp->result is meaningless.
  189.  * TCL_CONTINUE        Go on to the next iteration of the current loop;
  190.  *            interp->result is meaningless.
  191.  */
  192.  
  193. #define TCL_OK        0
  194. #define TCL_ERROR    1
  195. #define TCL_RETURN    2
  196. #define TCL_BREAK    3
  197. #define TCL_CONTINUE    4
  198.  
  199. #define TCL_RESULT_SIZE 200
  200.  
  201. /*
  202.  * Argument descriptors for math function callbacks in expressions:
  203.  */
  204.  
  205. typedef enum {TCL_INT, TCL_DOUBLE, TCL_EITHER} Tcl_ValueType;
  206. typedef struct Tcl_Value {
  207.     Tcl_ValueType type;        /* Indicates intValue or doubleValue is
  208.                  * valid, or both. */
  209.     long intValue;        /* Integer value. */
  210.     double doubleValue;        /* Double-precision floating value. */
  211. } Tcl_Value;
  212.  
  213. /*
  214.  * Procedure types defined by Tcl:
  215.  */
  216.  
  217. typedef int (Tcl_AppInitProc) _ANSI_ARGS_((Tcl_Interp *interp));
  218. typedef int (Tcl_AsyncProc) _ANSI_ARGS_((ClientData clientData,
  219.     Tcl_Interp *interp, int code));
  220. typedef void (Tcl_ChannelProc) _ANSI_ARGS_((ClientData clientData, int mask));
  221. typedef void (Tcl_CloseProc) _ANSI_ARGS_((ClientData data));
  222. typedef void (Tcl_CmdDeleteProc) _ANSI_ARGS_((ClientData clientData));
  223. typedef int (Tcl_CmdProc) _ANSI_ARGS_((ClientData clientData,
  224.     Tcl_Interp *interp, int argc, char *argv[]));
  225. typedef void (Tcl_CmdTraceProc) _ANSI_ARGS_((ClientData clientData,
  226.     Tcl_Interp *interp, int level, char *command, Tcl_CmdProc *proc,
  227.     ClientData cmdClientData, int argc, char *argv[]));
  228. typedef int (Tcl_EventProc) _ANSI_ARGS_((Tcl_Event *evPtr, int flags));
  229. typedef void (Tcl_EventCheckProc) _ANSI_ARGS_((ClientData clientData,
  230.     int flags));
  231. typedef int (Tcl_EventDeleteProc) _ANSI_ARGS_((Tcl_Event *evPtr,
  232.         ClientData clientData));
  233. typedef void (Tcl_EventSetupProc) _ANSI_ARGS_((ClientData clientData,
  234.     int flags));
  235. typedef void (Tcl_ExitProc) _ANSI_ARGS_((ClientData clientData));
  236. typedef void (Tcl_FileProc) _ANSI_ARGS_((ClientData clientData, int mask));
  237. typedef void (Tcl_FileFreeProc) _ANSI_ARGS_((ClientData clientData));
  238. typedef void (Tcl_FreeProc) _ANSI_ARGS_((char *blockPtr));
  239. typedef void (Tcl_IdleProc) _ANSI_ARGS_((ClientData clientData));
  240. typedef void (Tcl_InterpDeleteProc) _ANSI_ARGS_((ClientData clientData,
  241.     Tcl_Interp *interp));
  242. typedef int (Tcl_MathProc) _ANSI_ARGS_((ClientData clientData,
  243.     Tcl_Interp *interp, Tcl_Value *args, Tcl_Value *resultPtr));
  244. typedef int (Tcl_PackageInitProc) _ANSI_ARGS_((Tcl_Interp *interp));
  245. typedef void (Tcl_TcpAcceptProc) _ANSI_ARGS_((ClientData callbackData,
  246.         Tcl_Channel chan, char *address, int port));
  247. typedef void (Tcl_TimerProc) _ANSI_ARGS_((ClientData clientData));
  248. typedef char *(Tcl_VarTraceProc) _ANSI_ARGS_((ClientData clientData,
  249.     Tcl_Interp *interp, char *part1, char *part2, int flags));
  250.  
  251. /*
  252.  * The structure returned by Tcl_GetCmdInfo and passed into
  253.  * Tcl_SetCmdInfo:
  254.  */
  255.  
  256. typedef struct Tcl_CmdInfo {
  257.     Tcl_CmdProc *proc;            /* Procedure to implement command. */
  258.     ClientData clientData;        /* ClientData passed to proc. */
  259.     Tcl_CmdDeleteProc *deleteProc;    /* Procedure to call when command
  260.                      * is deleted. */
  261.     ClientData deleteData;        /* Value to pass to deleteProc (usually
  262.                      * the same as clientData). */
  263. } Tcl_CmdInfo;
  264.  
  265. /*
  266.  * The structure defined below is used to hold dynamic strings.  The only
  267.  * field that clients should use is the string field, and they should
  268.  * never modify it.
  269.  */
  270.  
  271. #define TCL_DSTRING_STATIC_SIZE 200
  272. typedef struct Tcl_DString {
  273.     char *string;        /* Points to beginning of string:  either
  274.                  * staticSpace below or a malloc'ed array. */
  275.     int length;            /* Number of non-NULL characters in the
  276.                  * string. */
  277.     int spaceAvl;        /* Total number of bytes available for the
  278.                  * string and its terminating NULL char. */
  279.     char staticSpace[TCL_DSTRING_STATIC_SIZE];
  280.                 /* Space to use in common case where string
  281.                  * is small. */
  282. } Tcl_DString;
  283.  
  284. #define Tcl_DStringLength(dsPtr) ((dsPtr)->length)
  285. #define Tcl_DStringValue(dsPtr) ((dsPtr)->string)
  286. #define Tcl_DStringTrunc Tcl_DStringSetLength
  287.  
  288. /*
  289.  * Definitions for the maximum number of digits of precision that may
  290.  * be specified in the "tcl_precision" variable, and the number of
  291.  * characters of buffer space required by Tcl_PrintDouble.
  292.  */
  293.  
  294. #define TCL_MAX_PREC 17
  295. #define TCL_DOUBLE_SPACE (TCL_MAX_PREC+10)
  296.  
  297. /*
  298.  * Flag that may be passed to Tcl_ConvertElement to force it not to
  299.  * output braces (careful!  if you change this flag be sure to change
  300.  * the definitions at the front of tclUtil.c).
  301.  */
  302.  
  303. #define TCL_DONT_USE_BRACES    1
  304.  
  305. /*
  306.  * Flag values passed to Tcl_RecordAndEval.
  307.  * WARNING: these bit choices must not conflict with the bit choices
  308.  * for evalFlag bits in tclInt.h!!
  309.  */
  310.  
  311. #define TCL_NO_EVAL        0x10000
  312. #define TCL_EVAL_GLOBAL        0x20000
  313.  
  314. /*
  315.  * Special freeProc values that may be passed to Tcl_SetResult (see
  316.  * the man page for details):
  317.  */
  318.  
  319. #define TCL_VOLATILE    ((Tcl_FreeProc *) 1)
  320. #define TCL_STATIC    ((Tcl_FreeProc *) 0)
  321. #define TCL_DYNAMIC    ((Tcl_FreeProc *) 3)
  322.  
  323. /*
  324.  * Flag values passed to variable-related procedures.
  325.  */
  326.  
  327. #define TCL_GLOBAL_ONLY        1
  328. #define TCL_APPEND_VALUE    2
  329. #define TCL_LIST_ELEMENT    4
  330. #define TCL_TRACE_READS        0x10
  331. #define TCL_TRACE_WRITES    0x20
  332. #define TCL_TRACE_UNSETS    0x40
  333. #define TCL_TRACE_DESTROYED    0x80
  334. #define TCL_INTERP_DESTROYED    0x100
  335. #define TCL_LEAVE_ERR_MSG    0x200
  336. #ifdef STk_CODE
  337. #  define STk_STRINGIFY        0x400    /* tells Tcl_SetVar to stringify value */
  338. #endif
  339.  
  340.  
  341. /*
  342.  * Types for linked variables:
  343.  */
  344.  
  345. #define TCL_LINK_INT        1
  346. #define TCL_LINK_DOUBLE        2
  347. #define TCL_LINK_BOOLEAN    3
  348. #define TCL_LINK_STRING        4
  349. #define TCL_LINK_READ_ONLY    0x80
  350.  
  351. /*
  352.  * The following declarations either map ckalloc and ckfree to
  353.  * malloc and free, or they map them to procedures with all sorts
  354.  * of debugging hooks defined in tclCkalloc.c.
  355.  */
  356.  
  357. #ifdef TCL_MEM_DEBUG
  358.  
  359. #  define ckalloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__)
  360. #  define ckfree(x)  Tcl_DbCkfree(x, __FILE__, __LINE__)
  361. #  define ckrealloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__)
  362.  
  363. EXTERN int        Tcl_DumpActiveMemory _ANSI_ARGS_((char *fileName));
  364. EXTERN void        Tcl_ValidateAllMemory _ANSI_ARGS_((char *file,
  365.                 int line));
  366.  
  367. #else
  368.  
  369. #  define ckalloc(x) malloc(x)
  370. #  define ckfree(x)  free(x)
  371. #  define ckrealloc(x,y) realloc(x,y)
  372.  
  373. #  define Tcl_DumpActiveMemory(x)
  374. #  define Tcl_ValidateAllMemory(x,y)
  375.  
  376. #endif /* TCL_MEM_DEBUG */
  377.  
  378. /*
  379.  * Macro to free result of interpreter.
  380.  */
  381.  
  382. #define Tcl_FreeResult(interp)                    \
  383.     if ((interp)->freeProc != 0) {                \
  384.     if (((interp)->freeProc == TCL_DYNAMIC)            \
  385.         || ((interp)->freeProc == (Tcl_FreeProc *) free)) {    \
  386.         ckfree((interp)->result);                \
  387.     } else {                        \
  388.         (*(interp)->freeProc)((interp)->result);        \
  389.     }                            \
  390.     (interp)->freeProc = 0;                    \
  391.     }
  392.  
  393. /*
  394.  * Forward declaration of Tcl_HashTable.  Needed by some C++ compilers
  395.  * to prevent errors when the forward reference to Tcl_HashTable is
  396.  * encountered in the Tcl_HashEntry structure.
  397.  */
  398.  
  399. #ifdef __cplusplus
  400. struct Tcl_HashTable;
  401. #endif
  402.  
  403. /*
  404.  * Structure definition for an entry in a hash table.  No-one outside
  405.  * Tcl should access any of these fields directly;  use the macros
  406.  * defined below.
  407.  */
  408.  
  409. typedef struct Tcl_HashEntry {
  410.     struct Tcl_HashEntry *nextPtr;    /* Pointer to next entry in this
  411.                      * hash bucket, or NULL for end of
  412.                      * chain. */
  413.     struct Tcl_HashTable *tablePtr;    /* Pointer to table containing entry. */
  414.     struct Tcl_HashEntry **bucketPtr;    /* Pointer to bucket that points to
  415.                      * first entry in this entry's chain:
  416.                      * used for deleting the entry. */
  417.     ClientData clientData;        /* Application stores something here
  418.                      * with Tcl_SetHashValue. */
  419.     union {                /* Key has one of these forms: */
  420.     char *oneWordValue;        /* One-word value for key. */
  421.     int words[1];            /* Multiple integer words for key.
  422.                      * The actual size will be as large
  423.                      * as necessary for this table's
  424.                      * keys. */
  425.     char string[4];            /* String for key.  The actual size
  426.                      * will be as large as needed to hold
  427.                      * the key. */
  428.     } key;                /* MUST BE LAST FIELD IN RECORD!! */
  429. } Tcl_HashEntry;
  430.  
  431. /*
  432.  * Structure definition for a hash table.  Must be in tcl.h so clients
  433.  * can allocate space for these structures, but clients should never
  434.  * access any fields in this structure.
  435.  */
  436.  
  437. #define TCL_SMALL_HASH_TABLE 4
  438. typedef struct Tcl_HashTable {
  439.     Tcl_HashEntry **buckets;        /* Pointer to bucket array.  Each
  440.                      * element points to first entry in
  441.                      * bucket's hash chain, or NULL. */
  442.     Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE];
  443.                     /* Bucket array used for small tables
  444.                      * (to avoid mallocs and frees). */
  445.     int numBuckets;            /* Total number of buckets allocated
  446.                      * at **bucketPtr. */
  447.     int numEntries;            /* Total number of entries present
  448.                      * in table. */
  449.     int rebuildSize;            /* Enlarge table when numEntries gets
  450.                      * to be this large. */
  451.     int downShift;            /* Shift count used in hashing
  452.                      * function.  Designed to use high-
  453.                      * order bits of randomized keys. */
  454.     int mask;                /* Mask value used in hashing
  455.                      * function. */
  456.     int keyType;            /* Type of keys used in this table. 
  457.                      * It's either TCL_STRING_KEYS,
  458.                      * TCL_ONE_WORD_KEYS, or an integer
  459.                      * giving the number of ints that
  460.                                          * is the size of the key.
  461.                      */
  462.     Tcl_HashEntry *(*findProc) _ANSI_ARGS_((struct Tcl_HashTable *tablePtr,
  463.         char *key));
  464.     Tcl_HashEntry *(*createProc) _ANSI_ARGS_((struct Tcl_HashTable *tablePtr,
  465.         char *key, int *newPtr));
  466. } Tcl_HashTable;
  467.  
  468. /*
  469.  * Structure definition for information used to keep track of searches
  470.  * through hash tables:
  471.  */
  472.  
  473. typedef struct Tcl_HashSearch {
  474.     Tcl_HashTable *tablePtr;        /* Table being searched. */
  475.     int nextIndex;            /* Index of next bucket to be
  476.                      * enumerated after present one. */
  477.     Tcl_HashEntry *nextEntryPtr;    /* Next entry to be enumerated in the
  478.                      * the current bucket. */
  479. } Tcl_HashSearch;
  480.  
  481. /*
  482.  * Acceptable key types for hash tables:
  483.  */
  484.  
  485. #define TCL_STRING_KEYS        0
  486. #define TCL_ONE_WORD_KEYS    1
  487.  
  488. /*
  489.  * Macros for clients to use to access fields of hash entries:
  490.  */
  491.  
  492. #define Tcl_GetHashValue(h) ((h)->clientData)
  493. #define Tcl_SetHashValue(h, value) ((h)->clientData = (ClientData) (value))
  494. #define Tcl_GetHashKey(tablePtr, h) \
  495.     ((char *) (((tablePtr)->keyType == TCL_ONE_WORD_KEYS) ? (h)->key.oneWordValue \
  496.                         : (h)->key.string))
  497.  
  498. /*
  499.  * Macros to use for clients to use to invoke find and create procedures
  500.  * for hash tables:
  501.  */
  502.  
  503. #define Tcl_FindHashEntry(tablePtr, key) \
  504.     (*((tablePtr)->findProc))(tablePtr, key)
  505. #define Tcl_CreateHashEntry(tablePtr, key, newPtr) \
  506.     (*((tablePtr)->createProc))(tablePtr, key, newPtr)
  507.  
  508. /*
  509.  * Flag values to pass to Tcl_DoOneEvent to disable searches
  510.  * for some kinds of events:
  511.  */
  512.  
  513. #define TCL_DONT_WAIT        (1<<1)
  514. #define TCL_WINDOW_EVENTS    (1<<2)
  515. #define TCL_FILE_EVENTS        (1<<3)
  516. #define TCL_TIMER_EVENTS    (1<<4)
  517. #define TCL_IDLE_EVENTS        (1<<5)    /* WAS 0x10 ???? */
  518. #define TCL_ALL_EVENTS        (~TCL_DONT_WAIT)
  519.  
  520. /*
  521.  * The following structure defines a generic event for the Tcl event
  522.  * system.  These are the things that are queued in calls to Tcl_QueueEvent
  523.  * and serviced later by Tcl_DoOneEvent.  There can be many different
  524.  * kinds of events with different fields, corresponding to window events,
  525.  * timer events, etc.  The structure for a particular event consists of
  526.  * a Tcl_Event header followed by additional information specific to that
  527.  * event.
  528.  */
  529.  
  530. struct Tcl_Event {
  531.     Tcl_EventProc *proc;    /* Procedure to call to service this event. */
  532.     struct Tcl_Event *nextPtr;    /* Next in list of pending events, or NULL. */
  533. };
  534.  
  535. /*
  536.  * Positions to pass to Tk_QueueEvent:
  537.  */
  538.  
  539. typedef enum {
  540.     TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK
  541. } Tcl_QueuePosition;
  542.  
  543. /*
  544.  * The following structure keeps is used to hold a time value, either as
  545.  * an absolute time (the number of seconds from the epoch) or as an
  546.  * elapsed time. On Unix systems the epoch is Midnight Jan 1, 1970 GMT.
  547.  * On Macintosh systems the epoch is Midnight Jan 1, 1904 GMT.
  548.  */
  549.  
  550. typedef struct Tcl_Time {
  551.     long sec;            /* Seconds. */
  552.     long usec;            /* Microseconds. */
  553. } Tcl_Time;
  554.  
  555. /*
  556.  * Bits to pass to Tcl_CreateFileHandler and Tcl_CreateChannelHandler
  557.  * to indicate what sorts of events are of interest:
  558.  */
  559.  
  560. #define TCL_READABLE    (1<<1)
  561. #define TCL_WRITABLE    (1<<2)
  562. #define TCL_EXCEPTION    (1<<3)
  563.  
  564. /*
  565.  * Flag values to pass to Tcl_OpenCommandChannel to indicate the
  566.  * disposition of the stdio handles.  TCL_STDIN, TCL_STDOUT, TCL_STDERR,
  567.  * are also used in Tcl_GetStdChannel.
  568.  */
  569.  
  570. #define TCL_STDIN        (1<<1)    
  571. #define TCL_STDOUT        (1<<2)
  572. #define TCL_STDERR        (1<<3)
  573. #define TCL_ENFORCE_MODE    (1<<4)
  574.  
  575. /*
  576.  * Typedefs for the various operations in a channel type:
  577.  */
  578.  
  579. typedef int    (Tcl_DriverBlockModeProc) _ANSI_ARGS_((ClientData instanceData,
  580.             Tcl_File inFile, Tcl_File outFile, int mode));
  581. typedef int    (Tcl_DriverCloseProc) _ANSI_ARGS_((ClientData instanceData,
  582.             Tcl_Interp *interp, Tcl_File inFile, Tcl_File outFile));
  583. typedef int    (Tcl_DriverInputProc) _ANSI_ARGS_((ClientData instanceData,
  584.             Tcl_File inFile, char *buf, int toRead,
  585.             int *errorCodePtr));
  586. typedef int    (Tcl_DriverOutputProc) _ANSI_ARGS_((ClientData instanceData,
  587.                 Tcl_File outFile, char *buf, int toWrite,
  588.                 int *errorCodePtr));
  589. typedef int    (Tcl_DriverSeekProc) _ANSI_ARGS_((ClientData instanceData,
  590.             Tcl_File inFile, Tcl_File outFile, long offset, int mode,
  591.             int *errorCodePtr));
  592. typedef int    (Tcl_DriverSetOptionProc) _ANSI_ARGS_((
  593.             ClientData instanceData, Tcl_Interp *interp,
  594.                     char *optionName, char *value));
  595. typedef int    (Tcl_DriverGetOptionProc) _ANSI_ARGS_((
  596.             ClientData instanceData, char *optionName,
  597.                     Tcl_DString *dsPtr));
  598.  
  599. /*
  600.  * Enum for different end of line translation and recognition modes.
  601.  */
  602.  
  603. typedef enum Tcl_EolTranslation {
  604.     TCL_TRANSLATE_AUTO,            /* Eol == \r, \n and \r\n. */
  605.     TCL_TRANSLATE_CR,            /* Eol == \r. */
  606.     TCL_TRANSLATE_LF,            /* Eol == \n. */
  607.     TCL_TRANSLATE_CRLF            /* Eol == \r\n. */
  608. } Tcl_EolTranslation;
  609.  
  610. /*
  611.  * struct Tcl_ChannelType:
  612.  *
  613.  * One such structure exists for each type (kind) of channel.
  614.  * It collects together in one place all the functions that are
  615.  * part of the specific channel type.
  616.  */
  617.  
  618. typedef struct Tcl_ChannelType {
  619.     char *typeName;            /* The name of the channel type in Tcl
  620.                                          * commands. This storage is owned by
  621.                                          * channel type. */
  622.     Tcl_DriverBlockModeProc *blockModeProc;
  623.                         /* Set blocking mode for the
  624.                                          * raw channel. May be NULL. */
  625.     Tcl_DriverCloseProc *closeProc;    /* Procedure to call to close
  626.                                          * the channel. */
  627.     Tcl_DriverInputProc *inputProc;    /* Procedure to call for input
  628.                                          * on channel. */
  629.     Tcl_DriverOutputProc *outputProc;    /* Procedure to call for output
  630.                                          * on channel. */
  631.     Tcl_DriverSeekProc *seekProc;    /* Procedure to call to seek
  632.                                          * on the channel. May be NULL. */
  633.     Tcl_DriverSetOptionProc *setOptionProc;
  634.                         /* Set an option on a channel. */
  635.     Tcl_DriverGetOptionProc *getOptionProc;
  636.                         /* Get an option from a channel. */
  637. } Tcl_ChannelType;
  638.  
  639. /*
  640.  * The following flags determine whether the blockModeProc above should
  641.  * set the channel into blocking or nonblocking mode. They are passed
  642.  * as arguments to the blockModeProc procedure in the above structure.
  643.  */
  644.  
  645. #define TCL_MODE_BLOCKING 0        /* Put channel into blocking mode. */
  646. #define TCL_MODE_NONBLOCKING 1        /* Put channel into nonblocking
  647.                      * mode. */
  648.  
  649. /*
  650.  * Types for file handles:
  651.  */
  652.  
  653. #define TCL_UNIX_FD    1
  654. #define TCL_MAC_FILE    2
  655. #define TCL_MAC_SOCKET    3
  656. #define TCL_WIN_PIPE    4
  657. #define TCL_WIN_FILE    5
  658. #define TCL_WIN_SOCKET    6
  659. #define TCL_WIN_CONSOLE 7
  660.  
  661. /*
  662.  * Enum for different types of file paths.
  663.  */
  664.  
  665. typedef enum Tcl_PathType {
  666.     TCL_PATH_ABSOLUTE,
  667.     TCL_PATH_RELATIVE,
  668.     TCL_PATH_VOLUME_RELATIVE
  669. } Tcl_PathType;
  670.  
  671. /*
  672.  * The following interface is exported for backwards compatibility, but
  673.  * is only implemented on Unix.  Portable applications should use
  674.  * Tcl_OpenCommandChannel, instead.
  675.  */
  676.  
  677. EXTERN int        Tcl_CreatePipeline _ANSI_ARGS_((Tcl_Interp *interp,
  678.                 int argc, char **argv, int **pidArrayPtr,
  679.                 int *inPipePtr, int *outPipePtr,
  680.                 int *errFilePtr));
  681.  
  682. /*
  683.  * Exported Tcl procedures:
  684.  */
  685.  
  686. EXTERN void        Tcl_AddErrorInfo _ANSI_ARGS_((Tcl_Interp *interp,
  687.                 char *message));
  688. EXTERN void        Tcl_AllowExceptions _ANSI_ARGS_((Tcl_Interp *interp));
  689. EXTERN void        Tcl_AppendElement _ANSI_ARGS_((Tcl_Interp *interp,
  690.                 char *string));
  691. EXTERN void        Tcl_AppendResult _ANSI_ARGS_(
  692.                     TCL_VARARGS(Tcl_Interp *,interp));
  693. EXTERN int        Tcl_AppInit _ANSI_ARGS_((Tcl_Interp *interp));
  694. EXTERN Tcl_AsyncHandler    Tcl_AsyncCreate _ANSI_ARGS_((Tcl_AsyncProc *proc,
  695.                 ClientData clientData));
  696. EXTERN void        Tcl_AsyncDelete _ANSI_ARGS_((Tcl_AsyncHandler async));
  697. EXTERN int        Tcl_AsyncInvoke _ANSI_ARGS_((Tcl_Interp *interp,
  698.                 int code));
  699. EXTERN void        Tcl_AsyncMark _ANSI_ARGS_((Tcl_AsyncHandler async));
  700. EXTERN int        Tcl_AsyncReady _ANSI_ARGS_((void));
  701. EXTERN void        Tcl_BackgroundError _ANSI_ARGS_((Tcl_Interp *interp));
  702. EXTERN char        Tcl_Backslash _ANSI_ARGS_((char *src,
  703.                 int *readPtr));
  704. EXTERN void        Tcl_CallWhenDeleted _ANSI_ARGS_((Tcl_Interp *interp,
  705.                 Tcl_InterpDeleteProc *proc,
  706.                 ClientData clientData));
  707. EXTERN void        Tcl_CancelIdleCall _ANSI_ARGS_((Tcl_IdleProc *idleProc,
  708.                 ClientData clientData));
  709. EXTERN VOID *        Tcl_Ckalloc _ANSI_ARGS_((unsigned int size));
  710. EXTERN void        Tcl_Ckfree _ANSI_ARGS_((char *ptr));
  711. EXTERN int        Tcl_Close _ANSI_ARGS_((Tcl_Interp *interp,
  712.                     Tcl_Channel chan));
  713. EXTERN int        Tcl_CommandComplete _ANSI_ARGS_((char *cmd));
  714. EXTERN char *        Tcl_Concat _ANSI_ARGS_((int argc, char **argv));
  715. EXTERN int        Tcl_ConvertElement _ANSI_ARGS_((char *src,
  716.                 char *dst, int flags));
  717. EXTERN int        Tcl_CreateAlias _ANSI_ARGS_((Tcl_Interp *slave,
  718.                 char *slaveCmd, Tcl_Interp *target,
  719.                     char *targetCmd, int argc, char **argv));
  720. EXTERN Tcl_Channel    Tcl_CreateChannel _ANSI_ARGS_((
  721.                     Tcl_ChannelType *typePtr, char *chanName,
  722.                             Tcl_File inFile, Tcl_File outFile,
  723.                             ClientData instanceData));
  724. EXTERN void        Tcl_CreateChannelHandler _ANSI_ARGS_((
  725.                 Tcl_Channel chan, int mask,
  726.                             Tcl_ChannelProc *proc, ClientData clientData));
  727. EXTERN void        Tcl_CreateCloseHandler _ANSI_ARGS_((
  728.                 Tcl_Channel chan, Tcl_CloseProc *proc,
  729.                             ClientData clientData));
  730. EXTERN Tcl_Command    Tcl_CreateCommand _ANSI_ARGS_((Tcl_Interp *interp,
  731.                 char *cmdName, Tcl_CmdProc *proc,
  732.                 ClientData clientData,
  733.                 Tcl_CmdDeleteProc *deleteProc));
  734. EXTERN void        Tcl_CreateEventSource _ANSI_ARGS_((
  735.                 Tcl_EventSetupProc *setupProc, Tcl_EventCheckProc
  736.                 *checkProc, ClientData clientData));
  737. EXTERN void        Tcl_CreateExitHandler _ANSI_ARGS_((Tcl_ExitProc *proc,
  738.                 ClientData clientData));
  739. EXTERN void        Tcl_CreateFileHandler _ANSI_ARGS_((
  740.                     Tcl_File file, int mask, Tcl_FileProc *proc,
  741.                 ClientData clientData));
  742. EXTERN Tcl_Interp *    Tcl_CreateInterp _ANSI_ARGS_((void));
  743. EXTERN void        Tcl_CreateMathFunc _ANSI_ARGS_((Tcl_Interp *interp,
  744.                 char *name, int numArgs, Tcl_ValueType *argTypes,
  745.                 Tcl_MathProc *proc, ClientData clientData));
  746. EXTERN void        Tcl_CreateModalTimeout _ANSI_ARGS_((int milliseconds,
  747.                 Tcl_TimerProc *proc, ClientData clientData));
  748. EXTERN Tcl_Interp    *Tcl_CreateSlave _ANSI_ARGS_((Tcl_Interp *interp,
  749.                     char *slaveName, int isSafe));
  750. EXTERN Tcl_TimerToken    Tcl_CreateTimerHandler _ANSI_ARGS_((int milliseconds,
  751.                 Tcl_TimerProc *proc, ClientData clientData));
  752. EXTERN Tcl_Trace    Tcl_CreateTrace _ANSI_ARGS_((Tcl_Interp *interp,
  753.                 int level, Tcl_CmdTraceProc *proc,
  754.                 ClientData clientData));
  755. EXTERN char *        Tcl_DbCkalloc _ANSI_ARGS_((unsigned int size,
  756.                 char *file, int line));
  757. EXTERN int        Tcl_DbCkfree _ANSI_ARGS_((char *ptr,
  758.                 char *file, int line));
  759. EXTERN char *        Tcl_DbCkrealloc _ANSI_ARGS_((char *ptr,
  760.                 unsigned int size, char *file, int line));
  761. EXTERN void        Tcl_DeleteAssocData _ANSI_ARGS_((Tcl_Interp *interp,
  762.                             char *name));
  763. EXTERN int        Tcl_DeleteCommand _ANSI_ARGS_((Tcl_Interp *interp,
  764.                 char *cmdName));
  765. EXTERN void        Tcl_DeleteChannelHandler _ANSI_ARGS_((
  766.                     Tcl_Channel chan, Tcl_ChannelProc *proc,
  767.                             ClientData clientData));
  768. EXTERN void        Tcl_DeleteCloseHandler _ANSI_ARGS_((
  769.                 Tcl_Channel chan, Tcl_CloseProc *proc,
  770.                             ClientData clientData));
  771. EXTERN void        Tcl_DeleteEventSource _ANSI_ARGS_((
  772.                 Tcl_EventSetupProc *setupProc,
  773.                 Tcl_EventCheckProc *checkProc,
  774.                 ClientData clientData));
  775. EXTERN void        Tcl_DeleteEvents _ANSI_ARGS_((
  776.                 Tcl_EventDeleteProc *proc,
  777.                             ClientData clientData));
  778. EXTERN void        Tcl_DeleteExitHandler _ANSI_ARGS_((Tcl_ExitProc *proc,
  779.                 ClientData clientData));
  780. EXTERN void        Tcl_DeleteFileHandler _ANSI_ARGS_((
  781.                     Tcl_File file));
  782. EXTERN void        Tcl_DeleteHashEntry _ANSI_ARGS_((
  783.                 Tcl_HashEntry *entryPtr));
  784. EXTERN void        Tcl_DeleteHashTable _ANSI_ARGS_((
  785.                 Tcl_HashTable *tablePtr));
  786. EXTERN void        Tcl_DeleteInterp _ANSI_ARGS_((Tcl_Interp *interp));
  787. EXTERN void        Tcl_DeleteModalTimeout _ANSI_ARGS_((
  788.                 Tcl_TimerProc *proc, ClientData clientData));
  789. EXTERN void        Tcl_DeleteTimerHandler _ANSI_ARGS_((
  790.                 Tcl_TimerToken token));
  791. EXTERN void        Tcl_DeleteTrace _ANSI_ARGS_((Tcl_Interp *interp,
  792.                 Tcl_Trace trace));
  793. EXTERN void        Tcl_DetachPids _ANSI_ARGS_((int numPids, int *pidPtr));
  794. EXTERN void        Tcl_DontCallWhenDeleted _ANSI_ARGS_((
  795.                 Tcl_Interp *interp, Tcl_InterpDeleteProc *proc,
  796.                 ClientData clientData));
  797. EXTERN int        Tcl_DoOneEvent _ANSI_ARGS_((int flags));
  798. EXTERN void        Tcl_DoWhenIdle _ANSI_ARGS_((Tcl_IdleProc *proc,
  799.                 ClientData clientData));
  800. EXTERN char *        Tcl_DStringAppend _ANSI_ARGS_((Tcl_DString *dsPtr,
  801.                 char *string, int length));
  802. EXTERN char *        Tcl_DStringAppendElement _ANSI_ARGS_((
  803.                 Tcl_DString *dsPtr, char *string));
  804. EXTERN void        Tcl_DStringEndSublist _ANSI_ARGS_((Tcl_DString *dsPtr));
  805. EXTERN void        Tcl_DStringFree _ANSI_ARGS_((Tcl_DString *dsPtr));
  806. EXTERN void        Tcl_DStringGetResult _ANSI_ARGS_((Tcl_Interp *interp,
  807.                 Tcl_DString *dsPtr));
  808. EXTERN void        Tcl_DStringInit _ANSI_ARGS_((Tcl_DString *dsPtr));
  809. EXTERN void        Tcl_DStringResult _ANSI_ARGS_((Tcl_Interp *interp,
  810.                 Tcl_DString *dsPtr));
  811. EXTERN void        Tcl_DStringSetLength _ANSI_ARGS_((Tcl_DString *dsPtr,
  812.                 int length));
  813. EXTERN void        Tcl_DStringStartSublist _ANSI_ARGS_((
  814.                 Tcl_DString *dsPtr));
  815. EXTERN int        Tcl_Eof _ANSI_ARGS_((Tcl_Channel chan));
  816. EXTERN char *        Tcl_ErrnoId _ANSI_ARGS_((void));
  817. EXTERN char *        Tcl_ErrnoMsg _ANSI_ARGS_((int err));
  818. EXTERN int        Tcl_Eval _ANSI_ARGS_((Tcl_Interp *interp, char *cmd));
  819. EXTERN int        Tcl_EvalFile _ANSI_ARGS_((Tcl_Interp *interp,
  820.                 char *fileName));
  821. EXTERN void        Tcl_EventuallyFree _ANSI_ARGS_((ClientData clientData,
  822.                 Tcl_FreeProc *freeProc));
  823. EXTERN void        Tcl_Exit _ANSI_ARGS_((int status));
  824. EXTERN int        Tcl_ExprBoolean _ANSI_ARGS_((Tcl_Interp *interp,
  825.                 char *string, int *ptr));
  826. EXTERN int        Tcl_ExprDouble _ANSI_ARGS_((Tcl_Interp *interp,
  827.                 char *string, double *ptr));
  828. EXTERN int        Tcl_ExprLong _ANSI_ARGS_((Tcl_Interp *interp,
  829.                 char *string, long *ptr));
  830. EXTERN int        Tcl_ExprString _ANSI_ARGS_((Tcl_Interp *interp,
  831.                 char *string));
  832. EXTERN int        Tcl_FileReady _ANSI_ARGS_((Tcl_File file,
  833.                 int mask));
  834. EXTERN void        Tcl_FindExecutable _ANSI_ARGS_((char *argv0));
  835. EXTERN Tcl_HashEntry *    Tcl_FirstHashEntry _ANSI_ARGS_((
  836.                 Tcl_HashTable *tablePtr,
  837.                 Tcl_HashSearch *searchPtr));
  838. EXTERN int        Tcl_Flush _ANSI_ARGS_((Tcl_Channel chan));
  839. EXTERN void         Tcl_FreeFile _ANSI_ARGS_((
  840.                     Tcl_File file));
  841. EXTERN int        Tcl_GetAlias _ANSI_ARGS_((Tcl_Interp *interp,
  842.                        char *slaveCmd, Tcl_Interp **targetInterpPtr,
  843.                             char **targetCmdPtr, int *argcPtr,
  844.                 char ***argvPtr));
  845. EXTERN ClientData    Tcl_GetAssocData _ANSI_ARGS_((Tcl_Interp *interp,
  846.                             char *name, Tcl_InterpDeleteProc **procPtr));
  847. EXTERN int        Tcl_GetBoolean _ANSI_ARGS_((Tcl_Interp *interp,
  848.                 char *string, int *boolPtr));
  849. EXTERN Tcl_Channel    Tcl_GetChannel _ANSI_ARGS_((Tcl_Interp *interp,
  850.                     char *chanName, int *modePtr));
  851. EXTERN int        Tcl_GetChannelBufferSize _ANSI_ARGS_((
  852.                     Tcl_Channel chan));
  853. EXTERN Tcl_File        Tcl_GetChannelFile _ANSI_ARGS_((Tcl_Channel chan,
  854.                     int direction));
  855. EXTERN ClientData    Tcl_GetChannelInstanceData _ANSI_ARGS_((
  856.                     Tcl_Channel chan));
  857. EXTERN int        Tcl_GetChannelOption _ANSI_ARGS_((Tcl_Channel chan,
  858.                     char *optionName, Tcl_DString *dsPtr));
  859. EXTERN char *        Tcl_GetChannelName _ANSI_ARGS_((Tcl_Channel chan));
  860. EXTERN Tcl_ChannelType * Tcl_GetChannelType _ANSI_ARGS_((Tcl_Channel chan));
  861. EXTERN int        Tcl_GetCommandInfo _ANSI_ARGS_((Tcl_Interp *interp,
  862.                 char *cmdName, Tcl_CmdInfo *infoPtr));
  863. EXTERN char *        Tcl_GetCommandName _ANSI_ARGS_((Tcl_Interp *interp,
  864.                 Tcl_Command command));
  865. EXTERN char *        Tcl_GetCwd _ANSI_ARGS_((char *buf, int len));
  866. EXTERN int        Tcl_GetDouble _ANSI_ARGS_((Tcl_Interp *interp,
  867.                 char *string, double *doublePtr));
  868. EXTERN int        Tcl_GetErrno _ANSI_ARGS_((void));
  869. EXTERN Tcl_File        Tcl_GetFile _ANSI_ARGS_((ClientData fileData,
  870.                 int type));
  871. EXTERN ClientData    Tcl_GetFileInfo _ANSI_ARGS_((Tcl_File file,
  872.                 int *typePtr));
  873. EXTERN char *        Tcl_GetHostName _ANSI_ARGS_((void));
  874. EXTERN int        Tcl_GetInt _ANSI_ARGS_((Tcl_Interp *interp,
  875.                 char *string, int *intPtr));
  876. EXTERN int        Tcl_GetInterpPath _ANSI_ARGS_((Tcl_Interp *askInterp,
  877.                 Tcl_Interp *slaveInterp));
  878. EXTERN Tcl_Interp    *Tcl_GetMaster _ANSI_ARGS_((Tcl_Interp *interp));
  879. EXTERN ClientData    Tcl_GetNotifierData _ANSI_ARGS_((Tcl_File file,
  880.                 Tcl_FileFreeProc **freeProcPtr));
  881. EXTERN int        Tcl_GetOpenFile _ANSI_ARGS_((Tcl_Interp *interp,
  882.                 char *string, int write, int checkUsage,
  883.                 ClientData *filePtr));
  884. EXTERN Tcl_PathType    Tcl_GetPathType _ANSI_ARGS_((char *path));
  885. EXTERN int        Tcl_Gets _ANSI_ARGS_((Tcl_Channel chan,
  886.                     Tcl_DString *dsPtr));
  887. EXTERN Tcl_Interp    *Tcl_GetSlave _ANSI_ARGS_((Tcl_Interp *interp,
  888.                 char *slaveName));
  889. EXTERN Tcl_Channel    Tcl_GetStdChannel _ANSI_ARGS_((int type));
  890. EXTERN char *        Tcl_GetVar _ANSI_ARGS_((Tcl_Interp *interp,
  891.                 char *varName, int flags));
  892. EXTERN char *        Tcl_GetVar2 _ANSI_ARGS_((Tcl_Interp *interp,
  893.                 char *part1, char *part2, int flags));
  894. EXTERN int        Tcl_GlobalEval _ANSI_ARGS_((Tcl_Interp *interp,
  895.                 char *command));
  896. EXTERN char *        Tcl_HashStats _ANSI_ARGS_((Tcl_HashTable *tablePtr));
  897. EXTERN int        Tcl_Init _ANSI_ARGS_((Tcl_Interp *interp));
  898. EXTERN void        Tcl_InitHashTable _ANSI_ARGS_((Tcl_HashTable *tablePtr,
  899.                 int keyType));
  900. EXTERN void        Tcl_InitMemory _ANSI_ARGS_((Tcl_Interp *interp));
  901. EXTERN int        Tcl_InputBlocked _ANSI_ARGS_((Tcl_Channel chan));
  902. EXTERN int        Tcl_InputBuffered _ANSI_ARGS_((Tcl_Channel chan));
  903. EXTERN int        Tcl_InterpDeleted _ANSI_ARGS_((Tcl_Interp *interp));
  904. EXTERN int        Tcl_IsSafe _ANSI_ARGS_((Tcl_Interp *interp));
  905. EXTERN char *        Tcl_JoinPath _ANSI_ARGS_((int argc, char **argv,
  906.                 Tcl_DString *resultPtr));
  907. EXTERN int        Tcl_LinkVar _ANSI_ARGS_((Tcl_Interp *interp,
  908.                 char *varName, char *addr, int type));
  909. EXTERN void        Tcl_Main _ANSI_ARGS_((int argc, char **argv,
  910.                 Tcl_AppInitProc *appInitProc));
  911. EXTERN Tcl_Channel    Tcl_MakeFileChannel _ANSI_ARGS_((ClientData inFile,
  912.                     ClientData outFile, int mode));
  913. EXTERN int        Tcl_MakeSafe _ANSI_ARGS_((Tcl_Interp *interp));
  914. EXTERN Tcl_Channel    Tcl_MakeTcpClientChannel _ANSI_ARGS_((
  915.                     ClientData tcpSocket));
  916. EXTERN char *        Tcl_Merge _ANSI_ARGS_((int argc, char **argv));
  917. EXTERN Tcl_HashEntry *    Tcl_NextHashEntry _ANSI_ARGS_((
  918.                 Tcl_HashSearch *searchPtr));
  919. EXTERN Tcl_Channel    Tcl_OpenCommandChannel _ANSI_ARGS_((
  920.                     Tcl_Interp *interp, int argc, char **argv,
  921.                 int flags));
  922. EXTERN Tcl_Channel    Tcl_OpenFileChannel _ANSI_ARGS_((Tcl_Interp *interp,
  923.                     char *fileName, char *modeString,
  924.                             int permissions));
  925. EXTERN Tcl_Channel    Tcl_OpenTcpClient _ANSI_ARGS_((Tcl_Interp *interp,
  926.                 int port, char *address, char *myaddr,
  927.                     int myport, int async));
  928. EXTERN Tcl_Channel    Tcl_OpenTcpServer _ANSI_ARGS_((Tcl_Interp *interp,
  929.                     int port, char *host,
  930.                     Tcl_TcpAcceptProc *acceptProc,
  931.                 ClientData callbackData));
  932. EXTERN char *        Tcl_ParseVar _ANSI_ARGS_((Tcl_Interp *interp,
  933.                 char *string, char **termPtr));
  934. EXTERN int        Tcl_PkgProvide _ANSI_ARGS_((Tcl_Interp *interp,
  935.                 char *name, char *version));
  936. EXTERN char *        Tcl_PkgRequire _ANSI_ARGS_((Tcl_Interp *interp,
  937.                 char *name, char *version, int exact));
  938. EXTERN char *        Tcl_PosixError _ANSI_ARGS_((Tcl_Interp *interp));
  939. EXTERN void        Tcl_Preserve _ANSI_ARGS_((ClientData data));
  940. EXTERN void        Tcl_PrintDouble _ANSI_ARGS_((Tcl_Interp *interp,
  941.                 double value, char *dst));
  942. EXTERN int        Tcl_PutEnv _ANSI_ARGS_((CONST char *string));
  943. EXTERN void        Tcl_QueueEvent _ANSI_ARGS_((Tcl_Event *evPtr,
  944.                 Tcl_QueuePosition position));
  945. EXTERN int        Tcl_Read _ANSI_ARGS_((Tcl_Channel chan,
  946.                     char *bufPtr, int toRead));
  947. EXTERN void        Tcl_ReapDetachedProcs _ANSI_ARGS_((void));
  948. EXTERN int        Tcl_RecordAndEval _ANSI_ARGS_((Tcl_Interp *interp,
  949.                 char *cmd, int flags));
  950. EXTERN Tcl_RegExp    Tcl_RegExpCompile _ANSI_ARGS_((Tcl_Interp *interp,
  951.                 char *string));
  952. EXTERN int        Tcl_RegExpExec _ANSI_ARGS_((Tcl_Interp *interp,
  953.                 Tcl_RegExp regexp, char *string, char *start));
  954. EXTERN int        Tcl_RegExpMatch _ANSI_ARGS_((Tcl_Interp *interp,
  955.                 char *string, char *pattern));
  956. EXTERN void        Tcl_RegExpRange _ANSI_ARGS_((Tcl_RegExp regexp,
  957.                 int index, char **startPtr, char **endPtr));
  958. EXTERN void        Tcl_RegisterChannel _ANSI_ARGS_((Tcl_Interp *interp,
  959.                     Tcl_Channel chan));
  960. EXTERN void        Tcl_Release _ANSI_ARGS_((ClientData clientData));
  961. EXTERN void        Tcl_ResetResult _ANSI_ARGS_((Tcl_Interp *interp));
  962. #define Tcl_Return Tcl_SetResult
  963. EXTERN int        Tcl_ScanElement _ANSI_ARGS_((char *string,
  964.                 int *flagPtr));
  965. EXTERN int        Tcl_Seek _ANSI_ARGS_((Tcl_Channel chan,
  966.                     int offset, int mode));
  967. EXTERN void        Tcl_SetAssocData _ANSI_ARGS_((Tcl_Interp *interp,
  968.                             char *name, Tcl_InterpDeleteProc *proc,
  969.                             ClientData clientData));
  970. EXTERN void        Tcl_SetChannelBufferSize _ANSI_ARGS_((
  971.                 Tcl_Channel chan, int sz));
  972. EXTERN int        Tcl_SetChannelOption _ANSI_ARGS_((
  973.                 Tcl_Interp *interp, Tcl_Channel chan,
  974.                     char *optionName, char *newValue));
  975. EXTERN int        Tcl_SetCommandInfo _ANSI_ARGS_((Tcl_Interp *interp,
  976.                 char *cmdName, Tcl_CmdInfo *infoPtr));
  977. EXTERN void        Tcl_SetErrno _ANSI_ARGS_((int errno));
  978. EXTERN void        Tcl_SetErrorCode _ANSI_ARGS_(
  979.                     TCL_VARARGS(Tcl_Interp *,interp));
  980. EXTERN void        Tcl_SetMaxBlockTime _ANSI_ARGS_((Tcl_Time *timePtr));
  981. EXTERN void        Tcl_SetNotifierData _ANSI_ARGS_((Tcl_File file,
  982.                 Tcl_FileFreeProc *freeProcPtr, ClientData data));
  983. EXTERN void        Tcl_SetPanicProc _ANSI_ARGS_((void (*proc)
  984.                 _ANSI_ARGS_(TCL_VARARGS(char *, format))));
  985. EXTERN int        Tcl_SetRecursionLimit _ANSI_ARGS_((Tcl_Interp *interp,
  986.                 int depth));
  987. EXTERN void        Tcl_SetResult _ANSI_ARGS_((Tcl_Interp *interp,
  988.                 char *string, Tcl_FreeProc *freeProc));
  989. EXTERN void        Tcl_SetStdChannel _ANSI_ARGS_((Tcl_Channel channel,
  990.                 int type));
  991. EXTERN char *        Tcl_SetVar _ANSI_ARGS_((Tcl_Interp *interp,
  992.                 char *varName, char *newValue, int flags));
  993. EXTERN char *        Tcl_SetVar2 _ANSI_ARGS_((Tcl_Interp *interp,
  994.                 char *part1, char *part2, char *newValue,
  995.                 int flags));
  996. EXTERN char *        Tcl_SignalId _ANSI_ARGS_((int sig));
  997. EXTERN char *        Tcl_SignalMsg _ANSI_ARGS_((int sig));
  998. EXTERN void        Tcl_Sleep _ANSI_ARGS_((int ms));
  999. EXTERN int        Tcl_SplitList _ANSI_ARGS_((Tcl_Interp *interp,
  1000.                 char *list, int *argcPtr, char ***argvPtr));
  1001. EXTERN void        Tcl_SplitPath _ANSI_ARGS_((char *path,
  1002.                 int *argcPtr, char ***argvPtr));
  1003. EXTERN void        Tcl_StaticPackage _ANSI_ARGS_((Tcl_Interp *interp,
  1004.                 char *pkgName, Tcl_PackageInitProc *initProc,
  1005.                 Tcl_PackageInitProc *safeInitProc));
  1006. EXTERN int        Tcl_StringMatch _ANSI_ARGS_((char *string,
  1007.                 char *pattern));
  1008. EXTERN int        Tcl_Tell _ANSI_ARGS_((Tcl_Channel chan));
  1009. #define Tcl_TildeSubst Tcl_TranslateFileName
  1010. EXTERN int        Tcl_TraceVar _ANSI_ARGS_((Tcl_Interp *interp,
  1011.                 char *varName, int flags, Tcl_VarTraceProc *proc,
  1012.                 ClientData clientData));
  1013. EXTERN int        Tcl_TraceVar2 _ANSI_ARGS_((Tcl_Interp *interp,
  1014.                 char *part1, char *part2, int flags,
  1015.                 Tcl_VarTraceProc *proc, ClientData clientData));
  1016. EXTERN char *        Tcl_TranslateFileName _ANSI_ARGS_((Tcl_Interp *interp,
  1017.                 char *name, Tcl_DString *bufferPtr));
  1018. EXTERN void        Tcl_UnlinkVar _ANSI_ARGS_((Tcl_Interp *interp,
  1019.                 char *varName));
  1020. EXTERN int        Tcl_UnregisterChannel _ANSI_ARGS_((Tcl_Interp *interp,
  1021.                 Tcl_Channel chan));
  1022. EXTERN int        Tcl_UnsetVar _ANSI_ARGS_((Tcl_Interp *interp,
  1023.                 char *varName, int flags));
  1024. EXTERN int        Tcl_UnsetVar2 _ANSI_ARGS_((Tcl_Interp *interp,
  1025.                 char *part1, char *part2, int flags));
  1026. EXTERN void        Tcl_UntraceVar _ANSI_ARGS_((Tcl_Interp *interp,
  1027.                 char *varName, int flags, Tcl_VarTraceProc *proc,
  1028.                 ClientData clientData));
  1029. EXTERN void        Tcl_UntraceVar2 _ANSI_ARGS_((Tcl_Interp *interp,
  1030.                 char *part1, char *part2, int flags,
  1031.                 Tcl_VarTraceProc *proc, ClientData clientData));
  1032. EXTERN void        Tcl_UpdateLinkedVar _ANSI_ARGS_((Tcl_Interp *interp,
  1033.                 char *varName));
  1034. EXTERN int        Tcl_UpVar _ANSI_ARGS_((Tcl_Interp *interp,
  1035.                 char *frameName, char *varName,
  1036.                 char *localName, int flags));
  1037. EXTERN int        Tcl_UpVar2 _ANSI_ARGS_((Tcl_Interp *interp,
  1038.                 char *frameName, char *part1, char *part2,
  1039.                 char *localName, int flags));
  1040. EXTERN int        Tcl_VarEval _ANSI_ARGS_(
  1041.                     TCL_VARARGS(Tcl_Interp *,interp));
  1042. EXTERN ClientData    Tcl_VarTraceInfo _ANSI_ARGS_((Tcl_Interp *interp,
  1043.                 char *varName, int flags,
  1044.                 Tcl_VarTraceProc *procPtr,
  1045.                 ClientData prevClientData));
  1046. EXTERN ClientData    Tcl_VarTraceInfo2 _ANSI_ARGS_((Tcl_Interp *interp,
  1047.                 char *part1, char *part2, int flags,
  1048.                 Tcl_VarTraceProc *procPtr,
  1049.                 ClientData prevClientData));
  1050. EXTERN int        Tcl_WaitForEvent _ANSI_ARGS_((Tcl_Time *timePtr));
  1051. EXTERN int        Tcl_WaitPid _ANSI_ARGS_((int pid, int *statPtr,
  1052.                             int options));
  1053. EXTERN void        Tcl_WatchFile _ANSI_ARGS_((Tcl_File file,
  1054.                 int mask));
  1055. EXTERN int        Tcl_Write _ANSI_ARGS_((Tcl_Channel chan,
  1056.                     char *s, int slen));
  1057.  
  1058. #endif /* _TCL */
  1059.